home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / var / lib / dpkg / info / dbus.postinst < prev    next >
Encoding:
Text File  |  2009-07-07  |  2.0 KB  |  64 lines

  1. #!/bin/sh
  2. # Copyright ¬© 2003 Colin Walters <walters@debian.org>
  3. # Copyright ¬© 2006 Sjoerd Simons <sjoerd@debian.org>
  4.  
  5. set -e
  6.  
  7. MESSAGEUSER=messagebus
  8. MESSAGEHOME=/var/run/dbus
  9. LAUNCHER=/lib/dbus-1.0/dbus-daemon-launch-helper
  10.  
  11. if [ "$1" = configure ]; then
  12.     if [ ! -d $MESSAGEHOME ]; then
  13.         mkdir -p $MESSAGEHOME
  14.     fi
  15.     adduser --system \
  16.             --home "$MESSAGEHOME" \
  17.             --no-create-home \
  18.             --disabled-password \
  19.             --group "$MESSAGEUSER"
  20.  
  21.     chown "$MESSAGEUSER":"$MESSAGEUSER" "$MESSAGEHOME"
  22.  
  23.     if ! dpkg-statoverride --list "$LAUNCHER" >/dev/null 2>&1; then
  24.             chown root:"$MESSAGEUSER" "$LAUNCHER"
  25.             chmod 4754 "$LAUNCHER"
  26.     fi
  27. fi
  28.  
  29. # update init script symlinks for new runlevels and priorities for upgrades
  30. # from older versions
  31. if [ "$1" = configure ] && dpkg --compare-versions "$2" lt-nl 1.1.20-1; then
  32.     echo "Reinstalling init script for new runlevels and priorities ..." >&2
  33.     # remove old init script symlinks; dh_installinit adds the proper
  34.     # update-rc.d snippet later on
  35.     update-rc.d -f dbus remove >/dev/null
  36. fi
  37.  
  38. if [ "$1" = configure ] && [ -n "$2" ] && [ -x "/etc/init.d/dbus" ]; then
  39.     # Do not restart dbus on upgrades, only on fresh installations.
  40.     # (dh_installinit -r creates a start action)
  41.     # But do reload it so the machine-id can be generated
  42.     if [ -e /var/run/dbus/pid ] && 
  43.       ps --no-heading -p $(cat /var/run/dbus/pid) > /dev/null; then
  44.         # trigger an update notification which recommends to reboot
  45.         [ -x /usr/share/update-notifier/notify-reboot-required ] && \
  46.             /usr/share/update-notifier/notify-reboot-required || true
  47.             invoke-rc.d dbus reload || true
  48.         exit 0
  49.     fi
  50. fi
  51.  
  52. # Automatically added by dh_installinit
  53. if [ -x "/etc/init.d/dbus" ]; then
  54.     update-rc.d dbus start 12 2 3 4 5 . stop 88 1 . >/dev/null
  55.     if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
  56.         invoke-rc.d dbus start || exit $?
  57.     else
  58.         /etc/init.d/dbus start || exit $?
  59.     fi
  60. fi
  61. # End automatically added section
  62.  
  63.  
  64.